package com.boot.service.impl;

import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.boot.entity.DailRecord;
import com.boot.mapper.DailRecordDao;
import com.boot.service.DailService;
import com.boot.util.AdResult;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.Date;
@Service
public class DailServiceImpl extends ServiceImpl<DailRecordDao, DailRecord> implements DailService {

	@Resource
	private DailRecordDao dailRecordDao;
	@Override
	public AdResult dailRecord(DailRecord dailRecord) {
		AdResult result=new AdResult();
		//设置点击电话按钮的时间
		Date now=new Date();
		dailRecord.setCalltime(now);
		int resultcode=dailRecordDao.recordDail(dailRecord);
		if(resultcode>0){
			result.setMsg("记录成功");
			result.setStatus(1);
		}else{
			result.setMsg("记录失败");
			result.setStatus(0);
		}
		return result;
	}

}
